<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
	<head>
		<title>MP3 Player for tests</title>
		<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
	<style type="text/css">
<!--
body,td,th {
	font-family: Trebuchet MS, Arial, Helvetica, sans-serif;
}

.htmlcode {
	font-family: "Courier New", Courier, monospace;
}
-->
    </style></head>
	<body>
    	<p><strong>MP3 Player for Listening Tests</strong></p>
<p> Copyright (C) 2009  Matt Bury</p>
    	<p><strong>Website</strong>: <a href="http://matbury.com/">http://matbury.com/</a></p>
    	<p><strong>Contact</strong>: matbury@gmail.com</p>
    	<p> <strong><img src="gplv3-127x51.png" alt="GPL" width="127" height="51" border="0" align="right" /></strong>This program is free software: You can redistribute it and/or modify    it under the terms of the GNU General Public License as published by    the Free Software Foundation, either version 3 of the License, or    (at your option) any later version.</p>
    	<p> This program is distributed in the hope that it will be useful,    but WITHOUT ANY WARRANTY; without even the implied warranty of    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    GNU General Public License for more details.    	  You should have received a copy of the <a href="General_Public_Licence.txt">GNU General Public Licence</a> along with this program.  If not, see &lt;<a href="http://www.gnu.org/licenses/">http://www.gnu.org/licenses/</a>&gt;.</p>
    	<p><strong>Description</strong></p>
    	<p>This is a Flash MP3 audio player developed for use in listening tests within learning management systems. It can be embedded, using the code provided, into web pages to provide listening materials for on-line tests where it is necessary or desirable to control the number of times that a learner can listen to an audio recording.  By default, the audio automatically plays once only and shows no controls. The number of times that the audio plays, showing a play button and waiting for the MP3 file to download completelt can be set by adding the optional parameters<span class="htmlcode"></span>.</p>
    	<p><strong>How to use</strong></p>
   	<p>This Flash application requires a moderate amount of web developer knowledge to be used successfully, although a beginner may be able to use and adapt the code given on this page by following the instructions carefully. Please note that I, Matt Bury, do not have the time to provide support to users who encounter problems with embedding the player. The embed code provided here is well known and the majority of web designers and web developers should have no problem in providing help. Also, please see the section below titled, &quot;Possible problems&quot; before seeking help.</p>
    	<p>Here is an example of the MP3 Player for Tests embedded in this web page:  	  </p>
    	<div align="center">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="1116" height="100" id="myFlashContent">
				<param name="movie" value="swf/mp3_test.swf" />
				<param name="flashvars" value="mp3url=mp3/little_prince_01.mp3&amp;timesToPlay=2&amp;showPlay=true&amp;waitToPlay=true&amp;showID3=true" />
				<!--[if !IE]>-->
				<object type="application/x-shockwave-flash" data="swf/mp3_test.swf" width="1116" height="100">
					<param name="flashvars" value="mp3url=mp3/little_prince_01.mp3&amp;timesToPlay=2&amp;showPlay=true&amp;waitToPlay=true&amp;showID3=true" />
				<!--<![endif]-->
					<a href="http://www.adobe.com/go/getflashplayer">
						<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
					</a>
				<!--[if !IE]>-->
				</object>
				<!--<![endif]-->
			</object>
         </div>
    	<p>The application is embedded using the following code:</p>
    	<table width="90%" border="1" align="center" cellpadding="10">
    	  <tr>
    	    <td class="htmlcode">&lt;div align=&quot;center&quot;&gt;<br />
    	        &lt;object classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot; width=&quot;600&quot; height=&quot;100&quot; id=&quot;myFlashContent&quot;&gt;<br />
&lt;param name=&quot;movie&quot; value=&quot;swf/mp3_test.swf&quot; /&gt;<br />
&lt;param name=&quot;flashvars&quot; value=&quot;mp3url=mp3/little_prince_01.mp3&amp;amp;timesToPlay=2&amp;amp;showPlay=true&amp;amp;waitToPlay=true&amp;amp;showID3=true&quot; /&gt;<br />
&lt;!--[if !IE]&gt;--&gt;<br />
&lt;object type=&quot;application/x-shockwave-flash&quot; data=&quot;swf/mp3_test.swf&quot; width=&quot;600&quot; height=&quot;100&quot;&gt;<br />
&lt;param name=&quot;flashvars&quot; value=&quot;mp3url=mp3/little_prince_01.mp3&amp;amp;timesToPlay=2&amp;amp;showPlay=true&amp;amp;waitToPlay=true&amp;amp;showID3=true&quot; /&gt;<br />
&lt;!--&lt;![endif]--&gt;<br />
&lt;a href=&quot;http://www.adobe.com/go/getflashplayer&quot;&gt;<br />
&lt;img src=&quot;http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif&quot; alt=&quot;Get Adobe Flash player&quot; /&gt;<br />
&lt;/a&gt;<br />
&lt;!--[if !IE]&gt;--&gt;<br />
&lt;/object&gt;<br />
&lt;!--&lt;![endif]--&gt;<br />
&lt;/object&gt;<br />
&lt;/div&gt;</td>
  	    </tr>
  	  </table>
    	<p>You can copy and paste this code into any HTML web page using a web or text editor. There are five lines of this code that you'll need to modify to make it work on your web site with the desired MP3 audio files. I've highlighted the parts that you need to edit in <strong>bold</strong>:</p>
    	<p><span class="htmlcode">3. &lt;object classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot; width=&quot;<strong>600</strong>&quot; height=&quot;<strong>100</strong>&quot; id=&quot;myFlashContent&quot;&gt;<br />
4. &lt;param name=&quot;movie&quot; value=&quot;<strong>swf/mp3_test.swf</strong>&quot; /&gt;<br />
5. &lt;param name=&quot;flashvars&quot; value=&quot;mp3url=<strong>mp3/little_prince_01.mp3</strong>&amp;amp;timesToPlay=<strong>2</strong>&amp;amp;showPlay=<strong>true</strong>&amp;amp;waitToPlay=<strong>true</strong>&amp;amp;showID3=<strong>true</strong>&quot; /&gt;</span></p>
   	<p>and</p>
    	<p><span class="htmlcode">7. &lt;object type=&quot;application/x-shockwave-flash&quot; data=&quot;<strong>swf/mp3_test.swf</strong>&quot; width=&quot;<strong>600</strong>&quot; height=&quot;<strong>100</strong>&quot;&gt;<br />
8. &lt;param name=&quot;flashvars&quot; value=&quot;mp3url=<strong>mp3/little_prince_01.mp3</strong>&amp;amp;timesToPlay=<strong>2</strong>&amp;amp;showPlay<strong>=true</strong>&amp;amp;waitToPlay=<strong>true</strong>&amp;amp;showID3=<strong>true</strong>&quot; /&gt;</span></p>
    <p>In both sets of lines, 3, 4 &amp; 5 and 7 &amp; 8, there are seven parameters*:</p>
    <table width="100%" border="0" cellpadding="10">
      <tr>
        <td width="3%">1.</td>
        <td width="9%">data/value</td>
        <td width="19%"><strong>swf/mp3_test.swf</strong></td>
        <td width="19%">(required)</td>
        <td width="50%">The Flash MP3 player</td>
      </tr>
      <tr>
        <td>2.</td>
        <td>mp3url</td>
        <td><strong>mp3/little_prince_01.mp3</strong></td>
        <td>(required)</td>
        <td>The MP3 file to load</td>
      </tr>
      <tr>
        <td>3.</td>
        <td>width</td>
        <td><strong>600</strong></td>
        <td>(required)</td>
        <td>Width in pixels of the Flash Player window</td>
      </tr>
      <tr>
        <td>4.</td>
        <td>height</td>
        <td><strong>100</strong></td>
        <td>(required)</td>
        <td>Height in pixels of the Flash Player window</td>
      </tr>
      <tr>
        <td>5.</td>
        <td>timesToPlay</td>
        <td><strong>2</strong></td>
        <td>(optional) default = 1</td>
        <td>Number of times to play MP3 file</td>
      </tr>
      <tr>
        <td>6.</td>
        <td>showPlay</td>
        <td><strong>true</strong></td>
        <td>(optional) default = false</td>
        <td>Show play button for user to click</td>
      </tr>
      <tr>
        <td>7.</td>
        <td>waitToPlay</td>
        <td><strong>true</strong></td>
        <td>(optional) default = false</td>
        <td>Wait for download to complete before playing</td>
      </tr>
      <tr>
        <td>8.</td>
        <td>showID3</td>
        <td><strong>true</strong></td>
        <td>(optional) default = false</td>
        <td>Display MP3 ID3 tag information (track number, track name, album, artist)</td>
      </tr>
    </table>
    <p>*Please note that &quot;<span class="htmlcode"><strong>&amp;amp;</strong></span>&quot; is a separator between  the parameters.</p>
    <p><strong>1 &amp; 2.</strong> MP3 Player URLs and Audio File URLs: This is the path to the mp3_test.swf application and the MP3 audio file from the web page. In Moodle, for example, it's best practice to store media files in the moodledata directory and access them via file.php. The following lines assume that your Moodle is at <strong>http://moodlesite.com/</strong>, the ID number of the course you want to embed the MP3 Player in is <strong>99 </strong>and the Flash and MP3 files are stored in the moodledata course files directory:</p>
    <p><span class="htmlcode">3. &lt;object classid=&quot;clsid:D27CDB6E-AE6D-11cf-96B8-444553540000&quot; width=&quot;<strong>600</strong>&quot; height=&quot;<strong>100</strong>&quot; id=&quot;myFlashContent&quot;&gt;<br />
4. &lt;param name=&quot;movie&quot; value=&quot;<strong>http://moodlesite.com/file.php/99/swf/mp3_test.swf</strong><strong></strong>&quot; /&gt;<br />
5. &lt;param name=&quot;flashvars&quot; value=&quot;mp3url=<strong>http://moodlesite.com/file.php/99/mp3/little_prince_01.mp3</strong>&amp;amp;timesToPlay=<strong>2</strong>&amp;amp;showPlay=<strong><strong>true</strong></strong>&amp;amp;waitToPlay=<strong><strong>true</strong></strong>&amp;amp;showID3=<strong><strong>true</strong></strong>&quot; /&gt;</span></p>
    <p>and</p>
    <p><span class="htmlcode">7. &lt;object type=&quot;application/x-shockwave-flash&quot; data=&quot;<strong>http://moodlesite.com/file.php/99/swf/mp3_test.swf</strong>&quot; width=&quot;<strong>600</strong>&quot; height=&quot;<strong>100</strong>&quot;&gt;<br />
      8. &lt;param name=&quot;flashvars&quot; value=&quot;mp3url=<strong>http://moodlesite.com/file.php/99/mp3/little_prince_01.mp3</strong>&amp;amp;timesToPlay=<strong>2</strong>&amp;amp;showPlay<strong>=true</strong>&amp;amp;waitToPlay=<strong>true</strong>&amp;amp;showID3=<strong>true</strong>&quot; /&gt;</span></p>
    <p><strong>3 &amp; 4.</strong> The Flash Player window dimensions: These determine the width and height of the Flash Player window in which the application appears. The MP3 Player automatically adjusts to the width of the window but not the height. I recommend experimenting with these parameters to see what happens. For example, if you set the height to less than 50 pixels, the ID3 data display at the bottom, i.e. MP3 track information, will be concealed. This  player is configured with a bad URL to show what happens in the event of an error:</p>
    <div align="center">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="600" height="50" id="myFlashContent">
				<param name="movie" value="swf/mp3_test.swf" />
				<param name="flashvars" value="mp3url=mp3/no_file.mp3" />
				<!--[if !IE]>-->
				<object type="application/x-shockwave-flash" data="swf/mp3_test.swf" width="600" height="50">
					<param name="flashvars" value="mp3url=mp3/no_file.mp3" />
				<!--<![endif]-->
					<a href="http://www.adobe.com/go/getflashplayer">
						<img src="http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif" alt="Get Adobe Flash player" />
					</a>
				<!--[if !IE]>-->
				</object>
				<!--<![endif]-->
	  </object>
    </div>
    <p><strong>5.</strong> Number of times to play the MP3 file: This parameter is optional and the default is 1. You can try changing the number to see what happens but it's pretty self-explanatory.</p>
    <p><strong>6.</strong> Show play button: This parameter is optional and the default is false. Setting it to true displays a play button and the MP3 player waits for the user to click on it to start playing the loaded MP3 file. Playback can start before the MP3 file has finished loading, otherwise known as progressive download.</p>
    <p><strong>7.</strong> Wait to play: This parameter is optional and the default is false. Setting it to true tells the player to wait until the loaded MP3 file has finished downloading before allowing playback to start. This is useful if you anticipate slow or intermittent internet connections that could interrupt the download while the student is listening.</p>
    <p><strong>Possible problems</strong></p>
    <p>Please note that some learning management systems use filtres that strip out certain types of code. If this embed code doesn't work, firstly, check that the code doesn't contain any errors and that the paths to the Flash and audio files are valid (copy and paste them into your browser's address bar), then check that your learning management system allows &lt;object&gt; and &lt;embed&gt; tags, which are necessary to embed Flash applications. You may need administrator priviledges to change these settings.</p>
    <p><strong>Future versions</strong></p>
    <p>If you have any requests for new features, find any bugs or would like to see something improved, please let me know on the project website on <a href="http://code.google.com/p/moodle-mp3-player-for-tests/">Google Code</a>. You can also contact me on my website or by email. Both are given at the top of this page.</p>
    <p>Good luck!</p>
    </body>
</html>